package cn.itcast.bos.web.action.base;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;

import cn.itcast.bos.domain.base.TakeTime;
import cn.itcast.bos.service.base.TakeTimeService;
import cn.itcast.bos.util.BaseAction;

/**
 * 排班类的action
 * 
 * @author 王文杰
 * @version 1.0, 2017-9-9 19:35:00
 */
@ParentPackage("json-default")
@Namespace("/")
@Controller
@Scope("prototype")
public class TakeTimeAction extends BaseAction<TakeTime>{

	/** 注入service对象 */
	@Autowired
	private TakeTimeService takeTimeService;
	
	@Action(value="taketime_findAll",results={@Result(name="success",type="json")})
	public String findAll(){
		// 调用业务层查询所有收派时间
		List<TakeTime> list = takeTimeService.findAll();
	
		// 把得到的集合压入值栈
		ActionContext.getContext().getValueStack().push(list);
		
		return SUCCESS;
	}
}
